package com.program.cloudmanagesystem.complaint.persistence;
import com.program.cloudmanagesystem.complaint.domain.Complaint;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository


public interface ComplaintMapper {
    @Select("select * from Complaint")
    List<Complaint> showComplaints();
    @Select("select * from Complaint where Complaint.object = #{object}")
    Complaint searchComplaint(String object);
    @Insert("insert into Complaint(name,time,phone,object,content,doingcontent,score,state) values (#{name},#{time},#{phone},#{object},#{content},#{doingcontent},#{score},#{state})")
    void insertComplaint(@Param("name") String name, @Param("time") String time, @Param("phone") String phone, @Param("object") String object, @Param("content") String content,@Param("doingcontent")String doingcontent,@Param("score")String score,@Param("state") String state);
    @Update("update Complaint set name = #{name},time = #{time},phone = #{phone},object = #{object},content = #{content},doingcontent = #{doingcontent},donecontent = #{donecontent},reply = #{reply},score = #{score},state = #{state},doingtime = #{doingtime},donetime = #{donetime},replytime = #{replytime} where Complaint.object = #{object}")
    void updateData(@Param("name") String name, @Param("time") String time, @Param("phone") String phone, @Param("object") String object, @Param("content") String content,@Param("doingcontent") String doingconetnt,@Param("donecontent") String donecontent,@Param("reply") String reply,@Param("score") String score,@Param("state") String state,@Param("doingtime") String doingtime,@Param("donetime") String donetime,@Param("replytime") String replytime);
}
